﻿@using System.Globalization
@using Abp.AspNetZeroCore.Timing
@using Abp.Web.Security.AntiForgery
@using CultureHelper = MyCompanyName.AbpZeroTemplate.Localization.CultureHelper
@model MyCompanyName.AbpZeroTemplate.Web.Models.Install.InstallViewModel
@inject AppTimes AppTimes
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@{
    Layout = null;
    AbpAntiForgeryManager.SetCookie(Context);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <title>AbpZeroTemplate Installation</title>

    <link rel="shortcut icon" href="~/favicon.ico" />
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/_Bundles/vendors.bundle.css" asp-append-version="true" />
    <link rel="stylesheet" href="/metronic/themes/default/css/style.bundle.css" asp-append-version="true" />
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/_Bundles/app-layout-libs.css" asp-append-version="true" />
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/_Bundles/common-styles.css" asp-append-version="true" />

    @if (CultureHelper.IsRtl)
    {
        <link rel="stylesheet" href="/Common/Styles/abp-zero-template-rtl.css" asp-append-version="true" />
    }

    <link rel="stylesheet" abp-href="/view-resources/Views/Install/Index.css" asp-append-version="true" />
</head>
<body class="kt-page--fixed kt-header--static">
    <div class="kt-content">
        <div class="kt-portlet">
            <div class="kt-portlet__head">
                <div class="kt-portlet__head-label">
                    <span class="kt-portlet__head-icon kt-hidden">
                        <i class="la la-gear"></i>
                    </span>
                    <h3 class="kt-portlet__head-title">
                        AbpZeroTemplate Installation
                    </h3>
                </div>
            </div>
            <form id="installForm" class="kt-form">
                <div class="kt-portlet__body">
                    <div class="kt-section kt-section--first">
                        <h5 class="kt-section__title">
                            Connection String
                        </h5>
                        <div class="kt-section__body">
                            <div class="form-group kt-form__group">
                                <input type="text" class="form-control" name="connectionString" autocomplete="new-password" placeholder="Connection string" required>
                            </div>
                        </div>
                        <div class="kt-separator kt-separator--border-dashed kt-separator--space-lg"></div>
                        <h5 class="kt-section__title">
                            Admin Password
                        </h5>
                        <div class="form-group kt-form__group">
                            <input type="password" class="form-control" id="adminPassword" name="adminPassword" autocomplete="new-password" placeholder="Admin password" required>
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="password" class="form-control" id="adminPasswordRepeat" name="adminPasswordRepeat" autocomplete="new-password" placeholder="Admin password again" required>
                        </div>
                        <div class="kt-separator kt-separator--border-dashed kt-separator--space-lg"></div>
                        <h5 class="kt-section__title">
                            Web Site Url
                        </h5>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control" name="webSiteUrl" value="@Model.AppSettingsJson.WebSiteUrl" placeholder="Web site URL">
                        </div>
                        <div class="kt-separator kt-separator--border-dashed kt-separator--space-lg"></div>
                        <h5 class="kt-section__title">
                            Default Language
                        </h5>
                        <div class="form-group kt-form__group">
                            <select class="form-control" name="defaultLanguage">
                                @foreach (var language in Model.Languages)
                                {
                                    <option value="@language.Name">@language.DisplayName</option>
                                }
                            </select>
                        </div>
                        <div class="kt-separator kt-separator--border-dashed kt-separator--space-lg"></div>
                        <h5 class="kt-section__title">
                            SMTP Settings
                        </h5>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control" name="defaultFromAddress" placeholder="Default from address">
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control" name="defaultFromDisplayName" placeholder="Default from displayName">
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control" name="smtpHost" placeholder="SMTP host">
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control edited" name="smtpPort" value="" placeholder="SMTP port">
                        </div>
                        <div class="form-group kt-form__group">
                            <label class="control-label col-md-12"></label>
                            <div class="kt-checkbox-list">
                                <label class="kt-checkbox">
                                    <input id="Settings_SmtpEnableSsl" type="checkbox" name="smtpEnableSsl" value="true">
                                    UseSsl
                                    <span></span>
                                </label>
                                <label class="kt-checkbox">
                                    <input id="Settings_SmtpUseDefaultCredentials" type="checkbox" name="smtpEnableSsl" value="true">
                                    Use Default Credentials
                                    <span></span>
                                </label>
                            </div>
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control edited" name="smtpDomain" placeholder="Domain name">
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control edited" name="smtpUserName" placeholder="User name">
                        </div>
                        <div class="form-group kt-form__group">
                            <input type="password" class="form-control edited" name="smtpPassword" id="SmtpPassword" placeholder="Password" autocomplete="new-password">
                        </div>
                        <div class="kt-separator kt-separator--border-dashed kt-separator--space-lg"></div>
                        <h5 class="kt-section__title">
                            Invoice Info
                        </h5>
                        <div class="form-group kt-form__group">
                            <input type="text" class="form-control" name="legalName" placeholder="Legal name">
                        </div>
                        <div class="form-group kt-form__group">
                            <textarea class="form-control" name="billAddress" rows="5" placeholder="Address"></textarea>
                        </div>
                    </div>
                </div>
                <div class="kt-portlet__foot">
                    <div class="kt-form__actions">
                        <button id="SaveButton" class="btn btn-primary">Save</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/app-layout-libs.js" asp-append-version="true"></script>
    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/scripts.bundle.js" asp-append-version="true"></script>

    <!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
    <script src="/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>

    <script type="text/javascript">
    abp.localization.currentCulture = $.extend({}, abp.localization.currentCulture, { displayNameEnglish: '@CultureInfo.CurrentUICulture.EnglishName' });
    </script>

    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/common-scripts.js" asp-append-version="true"></script>
    <script abp-src="/view-resources/Views/Install/Index.js" asp-append-version="true"></script>
</body>
</html>
